/*
 * 文件名：WeiChatLoginUser.java
 * 版权：Copyright 2012-2016 广州宝锶信息技术有限公司
 * 创建人：曾毅
 * 创建时间：2017年8月11日 下午3:42:52
 * 修改人：
 * 修改时间：
 * 修改内容：
 */
package com.baothink.weichat.dto.common;

import com.baothink.weichat.dto.base.TimeValidDto;

/**
 * 微信应用跳转时获取的用户信息
 * 
 * @author 曾毅
 * @version 1.0,2017年8月11日 下午3:42:52
 * @since weichat 0.0.1
 */
public class WeiChatLoginUser extends TimeValidDto{
	
	private String UserId;
	private String DeviceId;
	private String user_ticket;
	private int errcode;
	private String errmsg;
	
	
	public WeiChatLoginUser() {
		super();
	}
	
	public WeiChatLoginUser(String userId, String deviceId, String user_ticket, int errcode, String errmsg) {
		super();
		UserId = userId;
		DeviceId = deviceId;
		this.user_ticket = user_ticket;
		this.errcode = errcode;
		this.errmsg = errmsg;
	}
	
	public String getUserId() {
		return UserId;
	}
	public void setUserId(String userId) {
		UserId = userId;
	}
	public String getDeviceId() {
		return DeviceId;
	}
	public void setDeviceId(String deviceId) {
		DeviceId = deviceId;
	}
	public String getUser_ticket() {
		return user_ticket;
	}
	public void setUser_ticket(String user_ticket) {
		this.user_ticket = user_ticket;
	}
	public int getErrcode() {
		return errcode;
	}
	public void setErrcode(int errcode) {
		this.errcode = errcode;
	}
	public String getErrmsg() {
		return errmsg;
	}
	public void setErrmsg(String errmsg) {
		this.errmsg = errmsg;
	}
	
	public boolean isAvailable(){
		return null==user_ticket || super.isAvailable();
	}

	@Override
	public String toString() {
		return "WeiChatLoginUser [UserId=" + UserId + ", DeviceId=" + DeviceId + ", user_ticket=" + user_ticket
				+ ", errcode=" + errcode + ", errmsg=" + errmsg + ", getExpires_in()=" + getExpires_in()
				+ ", isAvailable()=" + isAvailable() + ", getSurplusValidTime()=" + getSurplusValidTime() + "]";
	}

	
}
